package com.fuyao.cloud.common.data.mybatis;

import com.fuyao.cloud.common.data.datascope.InterceptSelectPage;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;

/**
 * Mybatis 配置
 *
 * @author cloud
 * @date 2021/6/3
 */
@Data
@RefreshScope
@ConfigurationProperties("cloud.mybatis")
public class CloudMybatisProperties {

	/**
	 * 是否打印可执行 sql
	 */
	private boolean showSql = true;

	/**
	 * 注入 SelectPage 对象
	 * @return
	 */
	@Bean
	public InterceptSelectPage interceptSelectPage(){
		return new InterceptSelectPage();
	}

}
